package com.demo.controller;

import com.demo.bean.CustomerDTO;
import com.demo.model.UserContext;
import com.demo.provider.CustomerProvider;
import com.demo.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * CustomerController
 *
 * @author liujin
 * @date 2020/11/4 14:43
 */
@RestController
public class CustomerController implements CustomerProvider {

    @Autowired
    private CustomerService customerService;

    @Override
    public String customer(@Valid CustomerDTO dto) {

        System.out.println(UserContext.getUser());

        return customerService.customer(dto);
    }
}
